<head> 
<title>在线编码转换</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"> 
<meta http-equiv="Content-Language" content="zh-CN"> 
<meta name="keywords" content="OSCHINA.NET 在线工具,ostools,jsbin,加密/解密，Markdown,less,java api,php api,node.js api,QR Code">
<meta name="description" content="OSCHINA.NET在线工具,ostools为开发设计人员提供在线工具，提供jsbin在线 CSS、JS 调试，在线 Java API文档,在线 PHP API文档,在线 Node.js API文档,Less CSS编译器，MarkDown编译器等其他在线工具">
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon"> 
<link rel="stylesheet" href="/css/basic.css?20120912" type="text/css"> 
<script src="https://pagead2.googlesyndication.com/pagead/js/r20200219/r20190131/reactive_library_fy2019.js"></script><script src="https://www.googletagservices.com/activeview/js/current/osd.js?cb=%2Fr20100101"></script><script src="https://partner.googleadservices.com/gampad/cookie.js?domain=tool.oschina.net&amp;callback=_gfp_s_&amp;client=ca-pub-7090564139599510"></script><script src="https://pagead2.googlesyndication.com/pagead/js/r20200219/r20190131/show_ads_impl.js" id="google_shimpl"></script><script type="text/javascript" src="/js/jquery/jquery-1.7.2.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
<script src="/js/bootstrap/js/bootstrap.min.js"></script>
 
<link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=tool.oschina.net" as="script"><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=tool.oschina.net"></script></head>
<body>
    <!--     头部header开始    -->
<div id="header">
    <div class="wrapper">
        <div id="mainSearch">
 
                <!-- Put the following javascript before the closing </head> tag. -->
<style>
.go_search {width: 300px;}
.go_search .gsc-input td,.go_search .gsc-input tddiv {padding:0 0 0 0;margin:0 0 0 0;height:23px;}
.go_search .gsc-input input:focus{ 
border:none;
 
}
.go_search .gsc-input input {
    border:none;
    height:23px;
    width: 100%;
    padding: 0px;
    border: none;
    margin: 0px;
    height: auto;
    outline: none;
    -webkit-box-shadow:none;
    -moz-box-shadow:none;
    box-shadow:none;
    background-image: url(../img/google_custom_search_watermark.gif?20140625);
    background-color: rgb(255, 255, 255);
    background-position: 0% 50%;
    background-repeat: no-repeat no-repeat;
}
</style>
 
<div class="go_search">
<!-- Place this tag where you want the search box to render -->
</div>
        </div>
        <div id="logo" class="texthidden" onclick="javascript:location.href='/'">
            <h1>OSCHINA.NET在线工具</h1>
        </div>
    </div>
</div>
<!--     头部header结束    -->
    <script type="text/javascript" src="/js/ad/tag_osc.js?date=201903010"></script>
    <div class="wrapper ad-wrap" style="margin-top: 15px">
        <script type="text/javascript" src="/js/ad/tag.js?date=20140625"></script><script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- question-side -->
<ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-7090564139599510" data-ad-slot="9002503316" data-adsbygoogle-status="done" data-overlap-observer-io="false"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:970px;background-color:transparent;"><ins id="aswift_0_anchor" style="display:block;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:970px;background-color:transparent;"><iframe width="970" height="90" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;border:0px;width:970px;height:90px;"></iframe></ins></ins></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
 
 
 
    </div>
    <div id="mainContent" class="wrapper">
    <div class="toolName"><a href="https://tool.oschina.net/encode?type=3#" style="color:black;text-decorating:none">在线编码转换</a><a data-toggle="modal" href="#advice" style="float:right;text-decoration:none;"><span class="badge badge-important"><i class="icon-envelope icon-white"></i> Feedback</span></a></div>
    <div class="toolUsing clearfix">
    <div class="toolsTab  clearfix">
        <ul class="nav nav-tabs">
            <li><a onclick="javascript:location.href='/encode'">Native/Unicode</a></li>
            <li><a onclick="javascript:location.href='/encode?type=2'">Native/UTF-8</a></li>
            <li class="active"><a onclick="javascript:location.href='/encode?type=3'">Native/ASCII</a></li>
            <li><a onclick="javascript:location.href='/encode?type=4'">URL转码</a></li>
        </ul>
    </div>
                    <div class="alert">
<button class="close" data-dismiss="alert">×</button>
    <p>Java中的properties配置文件可以使用这种格式</p>
</div>
    <div class="leftBar">
        <div class="title">Native:</div>
        <textarea name="cipher" id="n_source" cols=100 rows=100></textarea>
    </div>
 
    <div class="operateLR">
        <div class="OptDetail Button">
            <label class="checkbox"><input type="checkbox" name="ignoreLetter" id="ignoreLetter" checked="true">不转换字母和数字</label>
            <br>
            <button class="btn btn-primary" onclick="javascript:native2ascii();" style="margin:0 0 10px 0;"> ASCII -&gt;</button>
            <button class="btn btn-primary" onclick="javascript:ascii2native();">&lt;- Native </button>
        </div>
    </div>
 
    <div class="rightBar">
        <div class="title">ASCII:</div>
        <textarea name="message" cols=100 rows=100 id="a_source" class="text_source"></textarea>
    </div>
<script>
////////////////////////////////////////////////////////////////////////////////
//
//  Copyright (c) 2008 http://www.native2ascii.com.  All rights reserved.
//    Author:Hans He
//    Date:2008-12-16
//
////////////////////////////////////////////////////////////////////////////////  
function native2ascii(){
    var character=document.getElementById("n_source").value.split("");
    var ascii="";
    for(var i=0;i<character.length;i++){
        var code=Number(character[i].charCodeAt(0));
        if(!document.getElementById("ignoreLetter").checked||code>127){
            var charAscii=code.toString(16);
            charAscii=new String("0000").substring(charAscii.length,4)+charAscii;
            ascii+="\\u"+charAscii;
        }
        else{
            ascii+=character[i];
        }
    }
    document.getElementById("a_source").value=ascii;
}
function ascii2native(){
    var character=document.getElementById("a_source").value.split("\\u");
    var native1=character[0];
    for(var i=1;i<character.length;i++){
        var code=character[i];
        native1+=String.fromCharCode(parseInt("0x"+code.substring(0,4)));
        if(code.length>4){
            native1+=code.substring(4,code.length);
        }
    }
    document.getElementById("n_source").value=native1;
}
</script>            </div>
</div>
 
    <!--     尾部footer开始    -->
<div id="footer">
    <p class="wrapper">
        在线工具 由 <a href="http://www.oschina.net/" target="_blank">OSCHINA.NET</a> 所有 | <a href="http://weibo.com/oschina2010" target="_blank">@新浪微博</a> |<a href="http://www.aliyun.com/" target="_blank">阿里云</a>提供服务器和带宽 |<a data-toggle="modal" href="#advice">意见反馈</a> | <a href="http://www.beian.miit.gov.cn/" target="_blank">粤ICP备12009483号-6</a> | <span style="color:#AAA;">深圳市奥思网络科技有限公司版权所有</span>      </p>
</div>
<!--     尾部footer结束    -->    <div class="modal hide fade" id="advice" style="display:none;">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h3>在线编码转换</h3>
      </div>
      <div class="modal-body">
        <p>在此填写您的意见信息：</p>
        <form class="well" id="advice_form">
            <input id="tool_name_f" type="hidden" name="tool_name" value="在线编码转换">
            <div class="input-prepend">
            <span class="add-on">Email邮箱:</span><input class="input-xlarge" type="text" id="advice_email" name="email" placeholder="在此输入您的Email" onblur="javascript:verifyEmail();" title="Email邮箱"><span style="color:#A00" id="email_error"> (必填) </span>
            </div>
 
            <label class="textarea">您的建议和意见：<br><textarea name="content" id="advice_content" style="width:480px;height:150px" placeholder="在此填写对  在线编码转换 的意见和建议"></textarea></label>
            <label class="input">验证码：
            <img style="margin-bottom:9px;" src="/action/jsbin/captcha" id="captcha_code" height="30px" width="80px" onclick="this.src = '/action/jsbin/captcha?'+new Date().getTime();">
            <input type="text" id="captcha_input" onkeyup="document.getElementById('verifyCode').value=this.value;" style="height:20px;width:30px;">
            <input id="verifyCode" name="verifyCode" type="hidden"></label>
        </form>
      </div>
      <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">取消</a>
        <a href="#" class="btn btn-primary" id="advice_submit" disabled="disabled">提交建议</a>
      </div>
    </div>
<script>
function verifyEmail(){
    if(null == $("#advice_email").val().match(/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)){
        $("#email_error").html(" email输入错误 ");
        $("#advice_email").focus();
    }
    else{
        $("#email_error").html("<i class='icon-ok'></i>");
        $("#advice_submit").removeAttr("disabled");
    }
}
$(document).ready(function (){
    $("#advice_submit").click(function (){
        $.post("/action/advice/add_advice",
        { tool_name : $("#tool_name_f").val() , email: $("#advice_email").val(), content: $("#advice_content").val() ,verifyCode: $("#verifyCode").val()},
        function (result){
            var m=eval('(' + result + ')');
            if("ok"==m.msg){
                alert("谢谢您的建议，我们会参考您的建议使ostools变得更好！");
                $('#advice').modal('hide');
                $("#captcha_code").attr("src",'/action/jsbin/captcha?'+new Date().getTime());
            }
            else{
                alert(m.msg);
            }
        });
    });
});
</script>
    <a class="bshareDiv" href="http://www.bshare.cn/share">分享按钮</a><script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#uuid=&amp;style=3&amp;fs=4&amp;textcolor=#fff&amp;bgcolor=#06C&amp;text=分享到&amp;pophcol=1"></script>
 
 
<!-- Generated by OSCTools.NET (Mon Feb 24 12:22:11 CST 2020) 2ms --><ins class="adsbygoogle adsbygoogle-noablate" data-adsbygoogle-status="done" style="display: none !important;"><ins id="aswift_1_expand" style="display:inline-table;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><ins id="aswift_1_anchor" style="display:block;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><iframe frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_1" name="aswift_1" style="left:0;position:absolute;top:0;border:0px;width:0px;height:0px;"></iframe></ins></ins></ins><iframe id="google_osd_static_frame_9464683770420" name="google_osd_static_frame" style="display: none; width: 0px; height: 0px;"></iframe></body><iframe id="google_esf" name="google_esf" src="https://googleads.g.doubleclick.net/pagead/html/r20200219/r20190131/zrt_lookup.html#" data-ad-client="ca-pub-7090564139599510" style="display: none;"></iframe>
